<include file="public@header"/>
</head>
<body>
<div class="wrap">
    <ul class="nav nav-tabs">
        <li><a href="{:url('Office/personnel')}">人员管理</a></li>
        <li class="active"><a href="{:url('Office/add')}">添加人员</a></li>
    </ul>
    <form method="post" class="form-horizontal js-ajax-form" action="{:url('Office/addpost')}">
        <fieldset>
            <div class="control-group">
                <label class="control-label">账号</label>
                <div class="controls">
                    <input type="text" class="form-control" name="user_login" placeholder="" required>
                    <span class="form-required">*</span>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">登陆密码</label>
                <div class="controls">
                    <input type="password" class="form-control" name="user_pass" placeholder="" required>
                    <span class="form-required">*</span>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">姓名</label>
                <div class="controls">
                    <input type="text" class="form-control" name="user_nickname" required>
                    <span class="form-required">*</span>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">性别</label>
                <div class="controls">
                    <select name="sex" class="form-control">
                        <option value="1">男</option>
                        <option value="2">女</option>
                    </select>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">所属部门</label>
                <div class="controls">
                    <select name="dept_id" class="form-control" required>
                        <option value="">--请选择--</option>
                        <volist name="dept" id="vo">
                            <option value="{$vo.id}">{$vo.department_name}</option>
                        </volist>
                    </select>
                    <span class="form-required">*</span>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">联系电话</label>
                <div class="controls">
                    <input type="text" class="form-control" name="mobile" required>
                    <span class="form-required">*</span>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">入职时间</label>
                <div class="controls">
                    <input type="text" class="js-date form-control" name="entry_time">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label">销售艺术墓权限</label>
                <div class="col-md-6 col-sm-10">
                    <label class="radio-inline">
                        <input type="radio" name="if_sale"  value="1"> 有
                    </label>
                    <label class="radio-inline">
                        <input type="radio" name="if_sale" checked value="0"> 无
                    </label>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label">PAD操作权限</label>
                <div class="col-md-6 col-sm-10">
                    <label class="radio-inline">
                        <input type="radio" name="if_pad"  value="1"> 有
                    </label>
                    <label class="radio-inline">
                        <input type="radio" name="if_pad" checked value="0"> 无
                    </label>
                </div>
            </div>
            <div class="form-group" id="diding_div" style="display: none">
                <label class="control-label">PAD抵顶人权限</label>
                <div class="col-md-6 col-sm-10">
                    <label class="radio-inline">
                        <input type="radio" name="if_diding"  value="1"> 有
                    </label>
                    <label class="radio-inline">
                        <input type="radio" name="if_diding" checked value="0"> 无
                    </label>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label">{:lang('STATUS')}</label>
                <div class="col-md-6 col-sm-10">
                    <label class="radio-inline">
                        <input type="radio" name="user_status" checked value="1"> {:lang('正常')}
                    </label>
                    <label class="radio-inline">
                        <input type="radio" name="user_status"  value="0"> {:lang('禁用')}
                    </label>
                </div>
            </div>
        </fieldset>
        <div class="form-actions">
            <button type="submit" class="btn btn-primary js-ajax-submit">{:lang('ADD')}</button>
            <a class="btn btn-default" href="javascript:history.back(-1);">{:lang('BACK')}</a>
        </div>
    </form>
</div>
<script type="text/javascript" src="__STATIC__/js/admin.js?v={:time()}"></script>
<script type="application/javascript">
        $("input[name='if_pad']").change(function(){
            var pad = $('input:radio[name="if_pad"]:checked').val();
            if(pad == 1){
                $("#diding_div").show();
            }else{
                $('input:radio[name="if_diding"]:first').removeAttr("checked");
                $('input:radio[name="if_diding"]:last').attr('checked', 'true');
                $("#diding_div").hide();
            }
        })
</script>
</body>
</html>